package co.yixiang.modules.activity.vo;


import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
import co.yixiang.modules.product.vo.YxStoreProductAttrQueryVo;
import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 秒杀产品表 查询结果对象
 * </p>
 *
 * @author hupeng
 * @date 2019-12-17
 */
@Data
public class StoreSeckillVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "秒杀产品评论信息")
    private YxStoreProductReplyQueryVo reply;

    @ApiModelProperty(value = "秒杀产品评论数量")
    private Integer replyCount;

    @ApiModelProperty(value = "秒杀产品信息")
    private YxStoreSeckillQueryVo storeInfo;

    @ApiModelProperty(value = "秒杀产品用户是否收藏")
    private Boolean userCollect = false;

    @ApiModelProperty(value = "模板名称")
    private String tempName;

    private List<YxStoreProductAttrQueryVo> productAttr = new ArrayList();

    private Map<String, YxStoreProductAttrValue> productValue = new LinkedHashMap<>();

    StoreSeckillVo(YxStoreProductReplyQueryVo reply, Integer replyCount, YxStoreSeckillQueryVo storeInfo, Boolean userCollect, String tempName, List<YxStoreProductAttrQueryVo> productAttr, Map<String, YxStoreProductAttrValue> productValue) {
        this.reply = reply;
        this.replyCount = replyCount;
        this.storeInfo = storeInfo;
        this.userCollect = userCollect;
        this.tempName = tempName;
        this.productAttr = productAttr;
        this.productValue = productValue;
    }

    private static Boolean $default$userCollect() {
        return false;
    }

    public static StoreSeckillVoBuilder builder() {
        return new StoreSeckillVoBuilder();
    }

    public static class StoreSeckillVoBuilder {
        private YxStoreProductReplyQueryVo reply;
        private Integer replyCount;
        private YxStoreSeckillQueryVo storeInfo;
        private Boolean userCollect$value;
        private boolean userCollect$set;
        private String tempName;
        private List<YxStoreProductAttrQueryVo> productAttr;
        private Map<String, YxStoreProductAttrValue> productValue;

        StoreSeckillVoBuilder() {
        }

        public StoreSeckillVoBuilder reply(YxStoreProductReplyQueryVo reply) {
            this.reply = reply;
            return this;
        }

        public StoreSeckillVoBuilder replyCount(Integer replyCount) {
            this.replyCount = replyCount;
            return this;
        }

        public StoreSeckillVoBuilder storeInfo(YxStoreSeckillQueryVo storeInfo) {
            this.storeInfo = storeInfo;
            return this;
        }

        public StoreSeckillVoBuilder userCollect(Boolean userCollect) {
            this.userCollect$value = userCollect;
            this.userCollect$set = true;
            return this;
        }

        public StoreSeckillVoBuilder tempName(String tempName) {
            this.tempName = tempName;
            return this;
        }

        public StoreSeckillVoBuilder productAttr(List<YxStoreProductAttrQueryVo> productAttr) {
            this.productAttr = productAttr;
            return this;
        }

        public StoreSeckillVoBuilder productValue(Map<String, YxStoreProductAttrValue> productValue) {
            this.productValue = productValue;
            return this;
        }

        public StoreSeckillVo build() {
            Boolean userCollect$value = this.userCollect$value;
            if (!this.userCollect$set) {
                userCollect$value = StoreSeckillVo.$default$userCollect();
            }
            return new StoreSeckillVo(reply, replyCount, storeInfo, userCollect$value, tempName, productAttr, productValue);
        }

        public String toString() {
            return "StoreSeckillVo.StoreSeckillVoBuilder(reply=" + this.reply + ", replyCount=" + this.replyCount + ", storeInfo=" + this.storeInfo + ", userCollect$value=" + this.userCollect$value + ", tempName=" + this.tempName + ", productAttr=" + this.productAttr + ", productValue=" + this.productValue + ")";
        }
    }
}
